clear all
set more off
program main
    * *** Add required packages from SSC to this list ***
    local ssc_packages "ietoolkit estout coefplot zscore somersd parmest qqvalue mhtreg pdslasso"
    * *** Add required packages from SSC to this list ***
	
	if !missing("`ssc_packages'") {
		foreach pkg in `ssc_packages' {
			* Install using ssc, but avoid re-installing if already present
			capture which `pkg'
			if _rc == 111 {                 
				dis "Installing `pkg'"
				quietly ssc install `pkg', replace
			}
		}
	}
	
	* Install lassopack (includes pdslasso) from SSC
	capture which pdslasso
	if _rc == 111 {
		dis "Installing lassopack (includes pdslasso)"
		quietly ssc install lassopack, replace
	}
	
	dis ""
	dis "All required packages have been installed successfully!"
	dis ""
	 
end
main